# coding:utf-8
# 执行命令locust -f localhost_lagou.py
#网址：http://localhost:8089/


from locust import HttpUser, TaskSet, task

class UserBehavior(TaskSet):

    @task(1)  # 读取服务器时间
    def index(self):
        self.client.get("/")

    @task(5)  # 读取指定日期之后未来n天的日期信息
    def profile(self):
        self.client.get("/Home/Goods/search.html?q=手机")


class WebsiteUser(HttpUser):
    tasks = [UserBehavior]
    host = 'http://localhost/index.php'
    min_wait = 5000
    max_wait = 9000
